#ifndef __BSP_BEEP_H
#define __BSP_BEEP_H

#include "main.h"

typedef enum
{
	BUZ_ID_Null =0x00,    		// 维持当前状态
	BUZ_ID_KEY =0x01,		      // 按键	
	BUZ_ID_StartUp =0x02,	  	// 开机
	BUZ_ID_WorkEnd =0x03,		 //工作结束音
	BUZ_ID_Shutdown =0x04,	  	// 关机
	BUZ_ID_Warm =0x05,		    //普通故障音
	BUZ_ID_Preheat =0x06,	     //预热结束音
	BUZ_ID_SilEnt =0x07,	      //立刻结束
	BUZ_ID_Error =0x08,		  //高危故障音
	BUZ_ID_Gas_End =0x09,			//灶具定时结束音
	BUZ_ID_Invalid =0x0a,			//无效按键
	BEEP_ID_Uart_Err =0x0b,       //串口故障
	BUZ_ID_MAX,
} Beep_ID;


typedef enum
{
	BEEP_PowerOn =0, // 上电
	BEEP_StartUp,	  	// 开机
	BEEP_Shutdown,	  // 关机
	BEEP_KEY,		   // 按键	
	BEEP_Uart_Err,       //串口故障
	
	
	BEEP_Warm,		    //普通故障音
	BEEP_WorkEnd,		  		 //工作结束音
	BEEP_Preheat,	  //预热结束音
	BEEP_Error,		  //高危故障音
	BEEP_Gas_End,			//灶具定时结束音
	BUZ_Tone_MAX,
} Beep_Tone;

typedef struct _BEEP_T
{
	Beep_Tone Tone; // 音乐声
	uint8_t ucEnalbe;
	uint8_t ucState;
	uint16_t usBeepTime;
	uint16_t usStopTime;
	uint8_t usToneNum;	 // 音调个数
	uint8_t usToneCount; // 当前第几声
	int8_t usCycle;	 // 当前音调循环次数
	uint16_t usCount;
	uint8_t usCycleCount;
	uint8_t ucMute; /* 1表示静音 */
} BEEP_T;

/* 供外部调用的函数声明 */
void BEEP_InitHard(void);
void BEEP_Start(Beep_Tone Tone, int8_t _usCycle);
void BEEP_Stop(void);
void BEEP_KeyTone(void);
void BEEP_Pro(void);

void BEEP_Pause(void);
void BEEP_Resume(void);

#endif
